import { h, Random } from "koishi"

export const name = "@nm的全体成员"

export function apply(ctx) {
  ctx.on("message", async session => {
    if (h.select(session.elements, "at").some(e => e.attrs.type === "all")) {
      const e = Random.pick([128560, 128560, 297, 297, 10, 10, 265])
      await session.onebot?._request("set_msg_emoji_like", { message_id: session.messageId, emoji_id: e }).catch(() => {})
    }
  })
}
